<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    {include file="common/head" /}
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row">
        <table class="layui-table" lay-even>
            <colgroup>
                <col width="150">
                <col>
            </colgroup>
            <tbody>
            <tr>
                <td>ID</td>
                <td>{$info.id}</td>
            </tr>
            <tr>
                <td>发布用户</td>
                <td>{$info['user']['mobile']}</td>
            </tr>

            <tr>
                <td>行驶证VIN码</td>
                <td>{$info['vin']}</td>
            </tr>

            <tr>
                <td>汽车品牌</td>
                <td>{$info['brand_name']}</td>
            </tr>

            <tr>
                <td>汽车系列</td>
                <td>{$info['series_name']} {$info['series_max']}  </td>
            </tr>
            <tr>
                <td>汽车型号</td>
                <td>{$info['car_name']}</td>
            </tr>

            <tr>
                <td>汽车颜色</td>
                <td>{$info['car_color']}</td>
            </tr>

            <tr>
                <td>上牌时间</td>
                <td>
                    {notempty name="info['card_time']"}
                        {$info['card_time']|date='Y-m'}
                    {/notempty}
                </td>
            </tr>
            <tr>
                <td>交强险到期时间</td>
                <td>
                    {notempty name="info['strong_time']"}
                    {$info['strong_time']|date='Y-m'}
                    {/notempty}
                </td>
            </tr>
            <tr>
                <td>年检到期时间</td>
                <td>
                    {notempty name="info['strong_time']"}
                    {$info['yearly_time']|date='Y-m'}
                    {/notempty}

                </td>
            </tr>

            <tr>
                <td>行驶里程</td>
                <td>{$info['mileage']}万公里</td>
            </tr>

            <tr>
                <td>售价</td>
                <td>{$info['price']}万元</td>
            </tr>

            <tr>
                <td>牌照归属地</td>
                <td>{$info['card_come']}</td>
            </tr>

            <tr>
                <td>过户次数</td>
                <td>{$info['transfer_times']}次</td>
            </tr>

            <tr>
                <td>看车地点</td>
                <td>{$info['address']}</td>
            </tr>

            <tr>
                <td>有无抵押</td>
                <td>{$info['pledge']}</td>
            </tr>

            <tr>
                <td>车辆性质</td>
                <td>{$info['nature']}</td>
            </tr>

            <tr>
                <td>变速箱</td>
                <td>{$info['car_case']}</td>
            </tr>
            <tr>
                <td>排放标准</td>
                <td>{$info['standard']}</td>
            </tr>

            <tr>
                <td>加装配置</td>
                <td>{$info['add_conf']}</td>
            </tr>

            <tr>
                <td>联系人</td>
                <td>{$info['real_name']}</td>
            </tr>

            <tr>
                <td>联系电话</td>
                <td>{$info['mobile']}</td>
            </tr>

            <tr>
                <td>发布时间</td>
                <td>{$info.create_time|date='Y-m-d H:i:s'}</td>
            </tr>
            <tr>
                <td>销售状态</td>
                <td>{$info['sell_status']|arrText=[0=>'未售',1=>'已售',-1=>'下架']}</td>
            </tr>
            <tr>
                <td>状态</td>
                <td>{$info['status']|arrText=[0=>'审核中',1=>'已通过',2=>'已拒绝']}</td>
            </tr>

            <tr>
                <td>车况描述{$info.invite_code}</td>
                <td>{$info['content']}</td>
            </tr>
            <tr>
                <td>行驶证</td>
                <td id="xsz">
                    <img src="{$info['vin_url']}" layer-src="{$info['vin_url']}" alt="">
                </td>
            </tr>

            <tr>
                <td>首图</td>
                <td id="head">
                    <img src="{$info['head_img']}" layer-src="{$info['head_img']}" alt="">
                </td>
            </tr>

            <tr>
                <td>图片</td>
                <td id="imglist">
                    {volist name="info['img_list']" id="vo"}
                    <img src="{$vo['thumb']}" layer-src="{$vo['thumb']}" alt="">
                    {/volist}
                </td>
            </tr>
            </tbody>
        </table>

        {neq name="info['status']" value="1"}
        <div class="layui-form-item">
            <button onclick="setStatus(1)" class="layui-btn" lay-filter="add" lay-submit="">
                审核通过
            </button>
            <button onclick="openRe()" class="layui-btn layui-btn-danger" lay-filter="add" lay-submit="">
                拒绝
            </button>
        </div>
        {/neq}

    </div>
</div>

<div id="idbox" style="display: none">

</div>
<script>
    var m;
    layui.use(['form', 'layer'],
        function () {
            $ = layui.jquery;
            var form = layui.form,
                layer = layui.layer;

            layer.photos({
                photos:"#head",
                anim:5
            });
            layer.photos({
                photos:"#imglist",
                anim:5
            });
            layer.photos({
                photos:"#xsz",
                anim:5
            });
        });

    function setStatus(status) {
        if(status==1){
            msg='您确定要【通过审核】吗？'
        }else{
            msg='您确定要【拒绝】吗？'
        }

        layer.confirm(msg,function(index){
            //发异步删除数据
            $.ajax({
                type: "POST",
                url: "{:url('acStatus')}",
                data: {id:'{$info["id"]}',status:status},
                dataType:'json',
                success: function (result) {
                    if(result.code){
                        layer.msg(result.msg,{icon:1,time:1000});
                        xadmin.close();
                        xadmin.father_reload();
                    }else{
                        layer.msg(result.msg,{icon:2,time:1000});
                    }
                },
                error: function(data) {
                    layer.msg(data.msg,{icon:2,time:1000});
                }

            });


        });
    }

    function openRe() {
        xadmin.open('拒绝通过','{:url("no_detail",["id"=>$info["id"],"type"=>0])}');

    }

</script>

</body>

</html>
